<script setup>
import { ref } from 'vue';
import sonCom from './components/sonCom.vue';
const msg = ref('这是父组件的值')
const onMsgChange = (event)=>{
  msg.value = event
}
</script>
<template>
  <h1> 我是父组件</h1>
  <sonCom :msg="msg" @update:msg="msg = $event" />
  <sonCom :msg="msg" @update:msg="onMsgChange" />
</template>
<style></style>
